import docx
from docx import Document
from docx.shared import RGBColor
file=docx.Document(r'D:\\四书章句集注.docx')
print("段落数:"+str(len(file.paragraphs)))


for p in file.paragraphs:
    for n in p.runs:
        rgb=str(n.font.color.rgb)
        #print(rgb)
        if rgb=="000000":
            print(n.text)
            if rgb=="FF0000":
                print(n.text)